import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 用户列表api接口集合
 */
export function useUserApi() {
    return {
        // 获取后台用户信息
        getSystemUserInfo: (data?: object) => {
            return request({
                url: '/lxs/saas/power/user/get_system_user_info',
                method: 'post',
                data,
            });
        },

        // 后台用户修改密码
        systemUserPasswordSubmit: (data?: object) => {
            return request({
                url: '/lxs/saas/power/user/change_password_submit',
                method: 'post',
                data,
            });
        },

        // 获取管理员列表页面数据
        getAdminListData: (data?: object) => {
            return request({
                url: '/lxs/saas/power/user/get_user_list',
                method: 'get',
                params: data,
            });
        },

        // 管理员表单提交
        adminFormSubmit: (data?: object) => {
            return request({
                url: '/lxs/saas/power/user/user_form_submit',
                method: 'post',
                data,
            });
        },

        // 删除管理员
        adminDeleteSubmit: (data?: object) => {
            return request({
                url: '/lxs/saas/power/user/delete_user_submit',
                method: 'post',
                data,
            });
        },
    };
}
